<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
    <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
    <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
    <script src="https://img.hcharts.cn/highcharts/themes/grid-light.js"></script>
</head>
<body>
<!--
*************************************************************************
   Generated by HCODE at 2017-07-10 18:09:03
   From: https://code.hcharts.cn/demos/hhhhxL?hc-theme=grid-light
*************************************************************************
 -->
<div id="container" style="min-width:400px;height:400px"></div>
<script src="/static/js/jquery-1.10.2.min.js"></script>
<script>

    $(function () {
        setInterval(function () {
            //定时器要执行的代码
            func()
        }, 30000);

        function func() {
            var data;
            $.ajax({
                url: "", context: document.body, async: false, success: function (getdata) {
                    data = getdata;

                    console.log(JSON.stringify(data));
                }
            });

            var chart = new Highcharts.Chart('container', {
                title: {
                    text: '发布统计',
                    x: -20,
                    backgroundColor: 'rgba(255, 255, 255, 0)',
                    plotBorderColor: null,
                    plotBackgroundImage: null,
                    borderWidth: 0
                },
                subtitle: {
                    text: ' ',
                    x: -20
                },
                xAxis: {
                    categories: data[0]
                },
                yAxis: {
                    title: {
                        text: ' '
                    },
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#808080'
                    }]
                },
                tooltip: {
                    valueSuffix: ' '
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle',
                    borderWidth: 0
                },
                series: data[1]

            });
            $('.highcharts-credits').hide();
            $('.highcharts-button,.highcharts-contextbutton,.highcharts-button-normal').hide()
        }

        func()
    })
</script>
</body>
</html>